
module frv_ifu_ibuf (
    input                   clk             ,
    input                   rst_n           ,
    // Program Downloader reset
    input                   pd_rst          ,

    input                   ib_flush        ,
    input                   ib_wreq         ,

    input [31:0]            ib_inst_data_i  ,
    input [31:0]            ib_pc_data_i    ,
    input                   ib_exp_vld_i    ,
    input [4:0]             ib_exp_code_i   ,
    input [31:0]            ib_bp_taddr_i   ,
    input                   ib_bp_taken_i   ,
    input [3:0]             ib_bp_bhtv_i    , // BHT Entry Value
    input [31:0]            ib_bp_phtv_i    , // PHT Entry Value
 
    input                   ib_rreq         , // ibuf read request
    output                  ib_vld_o        ,
    output [31:0]           ib_inst_data_o  ,
    output [31:0]           ib_pc_data_o    ,
    output                  ib_exp_vld_o    ,
    output [4:0]            ib_exp_code_o   ,
    output [31:0]           ib_bp_taddr_o   ,
    output                  ib_bp_taken_o   ,
    output [3:0]            ib_bp_bhtv_o    , // BHT Entry Value
    output [31:0]           ib_bp_phtv_o    , // PHT Entry Value

    //ibuffer full?
    output                  ib_ready        
); 

wire [$clog2(16):0]    ib_wprt,ib_wprt_nxt;
wire [$clog2(16):0]    ib_rprt,ib_rprt_nxt;
wire                                ib_almost_full;
wire                                ib_full;
wire                                ib_empty;
wire [$clog2(16):0]  ib_entry_num_resume;//,ib_entry_num_nxt;

wire         entry_vld_o[16-1:0]       ;
wire [31:0]  entry_inst_data_o[16-1:0] ;
wire [31:0]  entry_pc_data_o[16-1:0]   ;
wire         entry_exp_vld_o[16-1:0]   ;
wire [4:0]   entry_exp_code_o[16-1:0]  ;
wire [31:0]  entry_bp_taddr_o[16-1:0]  ;
wire         entry_bp_taken_o[16-1:0]  ;
wire [3:0]   entry_bp_bhtv_o[16-1:0]   ;
wire [31:0]  entry_bp_phtv_o[16-1:0]   ;

wire         entry_wen[16-1:0]         ;
wire         entry_flush[16-1:0]       ;

// Generate Output
assign ib_vld_o       = entry_vld_o[ib_rprt[$clog2(16)-1:0]];
assign ib_inst_data_o = entry_inst_data_o[ib_rprt[$clog2(16)-1:0]];
assign ib_pc_data_o   = entry_pc_data_o[ib_rprt[$clog2(16)-1:0]];   
assign ib_exp_vld_o   = entry_exp_vld_o[ib_rprt[$clog2(16)-1:0]];   
assign ib_exp_code_o  = entry_exp_code_o[ib_rprt[$clog2(16)-1:0]];   
assign ib_bp_taddr_o  = entry_bp_taddr_o[ib_rprt[$clog2(16)-1:0]];   
assign ib_bp_taken_o  = entry_bp_taken_o[ib_rprt[$clog2(16)-1:0]];   
assign ib_bp_bhtv_o   = entry_bp_bhtv_o[ib_rprt[$clog2(16)-1:0]];   
assign ib_bp_phtv_o   = entry_bp_phtv_o[ib_rprt[$clog2(16)-1:0]]; 

// Instruction Buffer reayd
assign ib_entry_num_resume   = ib_wprt[$clog2(16)] == ib_rprt[$clog2(16)] ?
                        (16 - ib_wprt[$clog2(16)-1:0] + ib_rprt[$clog2(16)-1:0]) :
                        (ib_rprt[$clog2(16)-1:0] - ib_wprt[$clog2(16)-1:0]);

assign ib_almost_full = ib_entry_num_resume == 1 || ib_entry_num_resume == 0;

assign ib_full        = {~ib_wprt[$clog2(16)],ib_wprt[$clog2(16)-1:0]} == ib_rprt;
assign ib_empty       = ib_wprt == ib_rprt;
assign ib_ready       = ~ib_almost_full;

assign ib_wprt_nxt    = ib_flush ? 0 :
                        ib_full ? ib_wprt :
                        ib_wreq ? ib_wprt + 1 : ib_wprt;

assign ib_rprt_nxt    = ib_flush ? 0 :
                        ib_empty ? ib_rprt :
                        ib_rreq ? ib_rprt + 1 : ib_rprt;

dffr #($clog2(16)+1) ib_wprt_ff(clk,rst_n,1'b1,ib_wprt_nxt,ib_wprt);
dffr #($clog2(16)+1) ib_rprt_ff(clk,rst_n,1'b1,ib_rprt_nxt,ib_rprt);

assign entry_wen[0] = ib_wreq && ~ib_full && ~ib_flush && ib_wprt[$clog2(16)-1:0] == 0;
assign entry_wen[1] = ib_wreq && ~ib_full && ~ib_flush && ib_wprt[$clog2(16)-1:0] == 1;
assign entry_wen[2] = ib_wreq && ~ib_full && ~ib_flush && ib_wprt[$clog2(16)-1:0] == 2;
assign entry_wen[3] = ib_wreq && ~ib_full && ~ib_flush && ib_wprt[$clog2(16)-1:0] == 3;
assign entry_wen[4] = ib_wreq && ~ib_full && ~ib_flush && ib_wprt[$clog2(16)-1:0] == 4;
assign entry_wen[5] = ib_wreq && ~ib_full && ~ib_flush && ib_wprt[$clog2(16)-1:0] == 5;
assign entry_wen[6] = ib_wreq && ~ib_full && ~ib_flush && ib_wprt[$clog2(16)-1:0] == 6;
assign entry_wen[7] = ib_wreq && ~ib_full && ~ib_flush && ib_wprt[$clog2(16)-1:0] == 7;
assign entry_wen[8] = ib_wreq && ~ib_full && ~ib_flush && ib_wprt[$clog2(16)-1:0] == 8;
assign entry_wen[9] = ib_wreq && ~ib_full && ~ib_flush && ib_wprt[$clog2(16)-1:0] == 9;
assign entry_wen[10] = ib_wreq && ~ib_full && ~ib_flush && ib_wprt[$clog2(16)-1:0] == 10;
assign entry_wen[11] = ib_wreq && ~ib_full && ~ib_flush && ib_wprt[$clog2(16)-1:0] == 11;
assign entry_wen[12] = ib_wreq && ~ib_full && ~ib_flush && ib_wprt[$clog2(16)-1:0] == 12;
assign entry_wen[13] = ib_wreq && ~ib_full && ~ib_flush && ib_wprt[$clog2(16)-1:0] == 13;
assign entry_wen[14] = ib_wreq && ~ib_full && ~ib_flush && ib_wprt[$clog2(16)-1:0] == 14;
assign entry_wen[15] = ib_wreq && ~ib_full && ~ib_flush && ib_wprt[$clog2(16)-1:0] == 15;


assign entry_flush[0] = (ib_flush || (ib_rreq && ib_rprt[$clog2(16)-1:0] == 0)) && entry_vld_o[0];
assign entry_flush[1] = (ib_flush || (ib_rreq && ib_rprt[$clog2(16)-1:0] == 1)) && entry_vld_o[1];
assign entry_flush[2] = (ib_flush || (ib_rreq && ib_rprt[$clog2(16)-1:0] == 2)) && entry_vld_o[2];
assign entry_flush[3] = (ib_flush || (ib_rreq && ib_rprt[$clog2(16)-1:0] == 3)) && entry_vld_o[3];
assign entry_flush[4] = (ib_flush || (ib_rreq && ib_rprt[$clog2(16)-1:0] == 4)) && entry_vld_o[4];
assign entry_flush[5] = (ib_flush || (ib_rreq && ib_rprt[$clog2(16)-1:0] == 5)) && entry_vld_o[5];
assign entry_flush[6] = (ib_flush || (ib_rreq && ib_rprt[$clog2(16)-1:0] == 6)) && entry_vld_o[6];
assign entry_flush[7] = (ib_flush || (ib_rreq && ib_rprt[$clog2(16)-1:0] == 7)) && entry_vld_o[7];
assign entry_flush[8] = (ib_flush || (ib_rreq && ib_rprt[$clog2(16)-1:0] == 8)) && entry_vld_o[8];
assign entry_flush[9] = (ib_flush || (ib_rreq && ib_rprt[$clog2(16)-1:0] == 9)) && entry_vld_o[9];
assign entry_flush[10] = (ib_flush || (ib_rreq && ib_rprt[$clog2(16)-1:0] == 10)) && entry_vld_o[10];
assign entry_flush[11] = (ib_flush || (ib_rreq && ib_rprt[$clog2(16)-1:0] == 11)) && entry_vld_o[11];
assign entry_flush[12] = (ib_flush || (ib_rreq && ib_rprt[$clog2(16)-1:0] == 12)) && entry_vld_o[12];
assign entry_flush[13] = (ib_flush || (ib_rreq && ib_rprt[$clog2(16)-1:0] == 13)) && entry_vld_o[13];
assign entry_flush[14] = (ib_flush || (ib_rreq && ib_rprt[$clog2(16)-1:0] == 14)) && entry_vld_o[14];
assign entry_flush[15] = (ib_flush || (ib_rreq && ib_rprt[$clog2(16)-1:0] == 15)) && entry_vld_o[15];
frv_ibuf_entry _ibuf_entry_0 (
.clk             (clk                  ),
.rst_n           (rst_n                ),
.pd_rst          (pd_rst               ),
.ibe_req         (entry_wen[0]        ),
.ibe_flush       (entry_flush[0]      ),
.ibe_inst_data_i (ib_inst_data_i       ),
.ibe_pc_data_i   (ib_pc_data_i         ),
.ibe_exp_vld_i   (ib_exp_vld_i         ),
.ibe_exp_code_i  (ib_exp_code_i        ),
.ibe_bp_taddr_i  (ib_bp_taddr_i        ),
.ibe_bp_taken_i  (ib_bp_taken_i        ),
.ibe_bp_bhtv_i   (ib_bp_bhtv_i         ),
.ibe_bp_phtv_i   (ib_bp_phtv_i         ),
.ibe_vld_o       (entry_vld_o[0]      ),
.ibe_inst_data_o (entry_inst_data_o[0]),
.ibe_pc_data_o   (entry_pc_data_o[0]  ),
.ibe_exp_vld_o   (entry_exp_vld_o[0]  ),
.ibe_exp_code_o  (entry_exp_code_o[0] ),
.ibe_bp_taddr_o  (entry_bp_taddr_o[0] ),
.ibe_bp_taken_o  (entry_bp_taken_o[0] ),
.ibe_bp_bhtv_o   (entry_bp_bhtv_o[0]  ),
.ibe_bp_phtv_o   (entry_bp_phtv_o[0]  )
);

frv_ibuf_entry _ibuf_entry_1 (
.clk             (clk                  ),
.rst_n           (rst_n                ),
.pd_rst          (pd_rst               ),
.ibe_req         (entry_wen[1]        ),
.ibe_flush       (entry_flush[1]      ),
.ibe_inst_data_i (ib_inst_data_i       ),
.ibe_pc_data_i   (ib_pc_data_i         ),
.ibe_exp_vld_i   (ib_exp_vld_i         ),
.ibe_exp_code_i  (ib_exp_code_i        ),
.ibe_bp_taddr_i  (ib_bp_taddr_i        ),
.ibe_bp_taken_i  (ib_bp_taken_i        ),
.ibe_bp_bhtv_i   (ib_bp_bhtv_i         ),
.ibe_bp_phtv_i   (ib_bp_phtv_i         ),
.ibe_vld_o       (entry_vld_o[1]      ),
.ibe_inst_data_o (entry_inst_data_o[1]),
.ibe_pc_data_o   (entry_pc_data_o[1]  ),
.ibe_exp_vld_o   (entry_exp_vld_o[1]  ),
.ibe_exp_code_o  (entry_exp_code_o[1] ),
.ibe_bp_taddr_o  (entry_bp_taddr_o[1] ),
.ibe_bp_taken_o  (entry_bp_taken_o[1] ),
.ibe_bp_bhtv_o   (entry_bp_bhtv_o[1]  ),
.ibe_bp_phtv_o   (entry_bp_phtv_o[1]  )
);

frv_ibuf_entry _ibuf_entry_2 (
.clk             (clk                  ),
.rst_n           (rst_n                ),
.pd_rst          (pd_rst               ),
.ibe_req         (entry_wen[2]        ),
.ibe_flush       (entry_flush[2]      ),
.ibe_inst_data_i (ib_inst_data_i       ),
.ibe_pc_data_i   (ib_pc_data_i         ),
.ibe_exp_vld_i   (ib_exp_vld_i         ),
.ibe_exp_code_i  (ib_exp_code_i        ),
.ibe_bp_taddr_i  (ib_bp_taddr_i        ),
.ibe_bp_taken_i  (ib_bp_taken_i        ),
.ibe_bp_bhtv_i   (ib_bp_bhtv_i         ),
.ibe_bp_phtv_i   (ib_bp_phtv_i         ),
.ibe_vld_o       (entry_vld_o[2]      ),
.ibe_inst_data_o (entry_inst_data_o[2]),
.ibe_pc_data_o   (entry_pc_data_o[2]  ),
.ibe_exp_vld_o   (entry_exp_vld_o[2]  ),
.ibe_exp_code_o  (entry_exp_code_o[2] ),
.ibe_bp_taddr_o  (entry_bp_taddr_o[2] ),
.ibe_bp_taken_o  (entry_bp_taken_o[2] ),
.ibe_bp_bhtv_o   (entry_bp_bhtv_o[2]  ),
.ibe_bp_phtv_o   (entry_bp_phtv_o[2]  )
);

frv_ibuf_entry _ibuf_entry_3 (
.clk             (clk                  ),
.rst_n           (rst_n                ),
.pd_rst          (pd_rst               ),
.ibe_req         (entry_wen[3]        ),
.ibe_flush       (entry_flush[3]      ),
.ibe_inst_data_i (ib_inst_data_i       ),
.ibe_pc_data_i   (ib_pc_data_i         ),
.ibe_exp_vld_i   (ib_exp_vld_i         ),
.ibe_exp_code_i  (ib_exp_code_i        ),
.ibe_bp_taddr_i  (ib_bp_taddr_i        ),
.ibe_bp_taken_i  (ib_bp_taken_i        ),
.ibe_bp_bhtv_i   (ib_bp_bhtv_i         ),
.ibe_bp_phtv_i   (ib_bp_phtv_i         ),
.ibe_vld_o       (entry_vld_o[3]      ),
.ibe_inst_data_o (entry_inst_data_o[3]),
.ibe_pc_data_o   (entry_pc_data_o[3]  ),
.ibe_exp_vld_o   (entry_exp_vld_o[3]  ),
.ibe_exp_code_o  (entry_exp_code_o[3] ),
.ibe_bp_taddr_o  (entry_bp_taddr_o[3] ),
.ibe_bp_taken_o  (entry_bp_taken_o[3] ),
.ibe_bp_bhtv_o   (entry_bp_bhtv_o[3]  ),
.ibe_bp_phtv_o   (entry_bp_phtv_o[3]  )
);

frv_ibuf_entry _ibuf_entry_4 (
.clk             (clk                  ),
.rst_n           (rst_n                ),
.pd_rst          (pd_rst               ),
.ibe_req         (entry_wen[4]        ),
.ibe_flush       (entry_flush[4]      ),
.ibe_inst_data_i (ib_inst_data_i       ),
.ibe_pc_data_i   (ib_pc_data_i         ),
.ibe_exp_vld_i   (ib_exp_vld_i         ),
.ibe_exp_code_i  (ib_exp_code_i        ),
.ibe_bp_taddr_i  (ib_bp_taddr_i        ),
.ibe_bp_taken_i  (ib_bp_taken_i        ),
.ibe_bp_bhtv_i   (ib_bp_bhtv_i         ),
.ibe_bp_phtv_i   (ib_bp_phtv_i         ),
.ibe_vld_o       (entry_vld_o[4]      ),
.ibe_inst_data_o (entry_inst_data_o[4]),
.ibe_pc_data_o   (entry_pc_data_o[4]  ),
.ibe_exp_vld_o   (entry_exp_vld_o[4]  ),
.ibe_exp_code_o  (entry_exp_code_o[4] ),
.ibe_bp_taddr_o  (entry_bp_taddr_o[4] ),
.ibe_bp_taken_o  (entry_bp_taken_o[4] ),
.ibe_bp_bhtv_o   (entry_bp_bhtv_o[4]  ),
.ibe_bp_phtv_o   (entry_bp_phtv_o[4]  )
);

frv_ibuf_entry _ibuf_entry_5 (
.clk             (clk                  ),
.rst_n           (rst_n                ),
.pd_rst          (pd_rst               ),
.ibe_req         (entry_wen[5]        ),
.ibe_flush       (entry_flush[5]      ),
.ibe_inst_data_i (ib_inst_data_i       ),
.ibe_pc_data_i   (ib_pc_data_i         ),
.ibe_exp_vld_i   (ib_exp_vld_i         ),
.ibe_exp_code_i  (ib_exp_code_i        ),
.ibe_bp_taddr_i  (ib_bp_taddr_i        ),
.ibe_bp_taken_i  (ib_bp_taken_i        ),
.ibe_bp_bhtv_i   (ib_bp_bhtv_i         ),
.ibe_bp_phtv_i   (ib_bp_phtv_i         ),
.ibe_vld_o       (entry_vld_o[5]      ),
.ibe_inst_data_o (entry_inst_data_o[5]),
.ibe_pc_data_o   (entry_pc_data_o[5]  ),
.ibe_exp_vld_o   (entry_exp_vld_o[5]  ),
.ibe_exp_code_o  (entry_exp_code_o[5] ),
.ibe_bp_taddr_o  (entry_bp_taddr_o[5] ),
.ibe_bp_taken_o  (entry_bp_taken_o[5] ),
.ibe_bp_bhtv_o   (entry_bp_bhtv_o[5]  ),
.ibe_bp_phtv_o   (entry_bp_phtv_o[5]  )
);

frv_ibuf_entry _ibuf_entry_6 (
.clk             (clk                  ),
.rst_n           (rst_n                ),
.pd_rst          (pd_rst               ),
.ibe_req         (entry_wen[6]        ),
.ibe_flush       (entry_flush[6]      ),
.ibe_inst_data_i (ib_inst_data_i       ),
.ibe_pc_data_i   (ib_pc_data_i         ),
.ibe_exp_vld_i   (ib_exp_vld_i         ),
.ibe_exp_code_i  (ib_exp_code_i        ),
.ibe_bp_taddr_i  (ib_bp_taddr_i        ),
.ibe_bp_taken_i  (ib_bp_taken_i        ),
.ibe_bp_bhtv_i   (ib_bp_bhtv_i         ),
.ibe_bp_phtv_i   (ib_bp_phtv_i         ),
.ibe_vld_o       (entry_vld_o[6]      ),
.ibe_inst_data_o (entry_inst_data_o[6]),
.ibe_pc_data_o   (entry_pc_data_o[6]  ),
.ibe_exp_vld_o   (entry_exp_vld_o[6]  ),
.ibe_exp_code_o  (entry_exp_code_o[6] ),
.ibe_bp_taddr_o  (entry_bp_taddr_o[6] ),
.ibe_bp_taken_o  (entry_bp_taken_o[6] ),
.ibe_bp_bhtv_o   (entry_bp_bhtv_o[6]  ),
.ibe_bp_phtv_o   (entry_bp_phtv_o[6]  )
);

frv_ibuf_entry _ibuf_entry_7 (
.clk             (clk                  ),
.rst_n           (rst_n                ),
.pd_rst          (pd_rst               ),
.ibe_req         (entry_wen[7]        ),
.ibe_flush       (entry_flush[7]      ),
.ibe_inst_data_i (ib_inst_data_i       ),
.ibe_pc_data_i   (ib_pc_data_i         ),
.ibe_exp_vld_i   (ib_exp_vld_i         ),
.ibe_exp_code_i  (ib_exp_code_i        ),
.ibe_bp_taddr_i  (ib_bp_taddr_i        ),
.ibe_bp_taken_i  (ib_bp_taken_i        ),
.ibe_bp_bhtv_i   (ib_bp_bhtv_i         ),
.ibe_bp_phtv_i   (ib_bp_phtv_i         ),
.ibe_vld_o       (entry_vld_o[7]      ),
.ibe_inst_data_o (entry_inst_data_o[7]),
.ibe_pc_data_o   (entry_pc_data_o[7]  ),
.ibe_exp_vld_o   (entry_exp_vld_o[7]  ),
.ibe_exp_code_o  (entry_exp_code_o[7] ),
.ibe_bp_taddr_o  (entry_bp_taddr_o[7] ),
.ibe_bp_taken_o  (entry_bp_taken_o[7] ),
.ibe_bp_bhtv_o   (entry_bp_bhtv_o[7]  ),
.ibe_bp_phtv_o   (entry_bp_phtv_o[7]  )
);

frv_ibuf_entry _ibuf_entry_8 (
.clk             (clk                  ),
.rst_n           (rst_n                ),
.pd_rst          (pd_rst               ),
.ibe_req         (entry_wen[8]        ),
.ibe_flush       (entry_flush[8]      ),
.ibe_inst_data_i (ib_inst_data_i       ),
.ibe_pc_data_i   (ib_pc_data_i         ),
.ibe_exp_vld_i   (ib_exp_vld_i         ),
.ibe_exp_code_i  (ib_exp_code_i        ),
.ibe_bp_taddr_i  (ib_bp_taddr_i        ),
.ibe_bp_taken_i  (ib_bp_taken_i        ),
.ibe_bp_bhtv_i   (ib_bp_bhtv_i         ),
.ibe_bp_phtv_i   (ib_bp_phtv_i         ),
.ibe_vld_o       (entry_vld_o[8]      ),
.ibe_inst_data_o (entry_inst_data_o[8]),
.ibe_pc_data_o   (entry_pc_data_o[8]  ),
.ibe_exp_vld_o   (entry_exp_vld_o[8]  ),
.ibe_exp_code_o  (entry_exp_code_o[8] ),
.ibe_bp_taddr_o  (entry_bp_taddr_o[8] ),
.ibe_bp_taken_o  (entry_bp_taken_o[8] ),
.ibe_bp_bhtv_o   (entry_bp_bhtv_o[8]  ),
.ibe_bp_phtv_o   (entry_bp_phtv_o[8]  )
);

frv_ibuf_entry _ibuf_entry_9 (
.clk             (clk                  ),
.rst_n           (rst_n                ),
.pd_rst          (pd_rst               ),
.ibe_req         (entry_wen[9]        ),
.ibe_flush       (entry_flush[9]      ),
.ibe_inst_data_i (ib_inst_data_i       ),
.ibe_pc_data_i   (ib_pc_data_i         ),
.ibe_exp_vld_i   (ib_exp_vld_i         ),
.ibe_exp_code_i  (ib_exp_code_i        ),
.ibe_bp_taddr_i  (ib_bp_taddr_i        ),
.ibe_bp_taken_i  (ib_bp_taken_i        ),
.ibe_bp_bhtv_i   (ib_bp_bhtv_i         ),
.ibe_bp_phtv_i   (ib_bp_phtv_i         ),
.ibe_vld_o       (entry_vld_o[9]      ),
.ibe_inst_data_o (entry_inst_data_o[9]),
.ibe_pc_data_o   (entry_pc_data_o[9]  ),
.ibe_exp_vld_o   (entry_exp_vld_o[9]  ),
.ibe_exp_code_o  (entry_exp_code_o[9] ),
.ibe_bp_taddr_o  (entry_bp_taddr_o[9] ),
.ibe_bp_taken_o  (entry_bp_taken_o[9] ),
.ibe_bp_bhtv_o   (entry_bp_bhtv_o[9]  ),
.ibe_bp_phtv_o   (entry_bp_phtv_o[9]  )
);

frv_ibuf_entry _ibuf_entry_10 (
.clk             (clk                  ),
.rst_n           (rst_n                ),
.pd_rst          (pd_rst               ),
.ibe_req         (entry_wen[10]        ),
.ibe_flush       (entry_flush[10]      ),
.ibe_inst_data_i (ib_inst_data_i       ),
.ibe_pc_data_i   (ib_pc_data_i         ),
.ibe_exp_vld_i   (ib_exp_vld_i         ),
.ibe_exp_code_i  (ib_exp_code_i        ),
.ibe_bp_taddr_i  (ib_bp_taddr_i        ),
.ibe_bp_taken_i  (ib_bp_taken_i        ),
.ibe_bp_bhtv_i   (ib_bp_bhtv_i         ),
.ibe_bp_phtv_i   (ib_bp_phtv_i         ),
.ibe_vld_o       (entry_vld_o[10]      ),
.ibe_inst_data_o (entry_inst_data_o[10]),
.ibe_pc_data_o   (entry_pc_data_o[10]  ),
.ibe_exp_vld_o   (entry_exp_vld_o[10]  ),
.ibe_exp_code_o  (entry_exp_code_o[10] ),
.ibe_bp_taddr_o  (entry_bp_taddr_o[10] ),
.ibe_bp_taken_o  (entry_bp_taken_o[10] ),
.ibe_bp_bhtv_o   (entry_bp_bhtv_o[10]  ),
.ibe_bp_phtv_o   (entry_bp_phtv_o[10]  )
);

frv_ibuf_entry _ibuf_entry_11 (
.clk             (clk                  ),
.rst_n           (rst_n                ),
.pd_rst          (pd_rst               ),
.ibe_req         (entry_wen[11]        ),
.ibe_flush       (entry_flush[11]      ),
.ibe_inst_data_i (ib_inst_data_i       ),
.ibe_pc_data_i   (ib_pc_data_i         ),
.ibe_exp_vld_i   (ib_exp_vld_i         ),
.ibe_exp_code_i  (ib_exp_code_i        ),
.ibe_bp_taddr_i  (ib_bp_taddr_i        ),
.ibe_bp_taken_i  (ib_bp_taken_i        ),
.ibe_bp_bhtv_i   (ib_bp_bhtv_i         ),
.ibe_bp_phtv_i   (ib_bp_phtv_i         ),
.ibe_vld_o       (entry_vld_o[11]      ),
.ibe_inst_data_o (entry_inst_data_o[11]),
.ibe_pc_data_o   (entry_pc_data_o[11]  ),
.ibe_exp_vld_o   (entry_exp_vld_o[11]  ),
.ibe_exp_code_o  (entry_exp_code_o[11] ),
.ibe_bp_taddr_o  (entry_bp_taddr_o[11] ),
.ibe_bp_taken_o  (entry_bp_taken_o[11] ),
.ibe_bp_bhtv_o   (entry_bp_bhtv_o[11]  ),
.ibe_bp_phtv_o   (entry_bp_phtv_o[11]  )
);

frv_ibuf_entry _ibuf_entry_12 (
.clk             (clk                  ),
.rst_n           (rst_n                ),
.pd_rst          (pd_rst               ),
.ibe_req         (entry_wen[12]        ),
.ibe_flush       (entry_flush[12]      ),
.ibe_inst_data_i (ib_inst_data_i       ),
.ibe_pc_data_i   (ib_pc_data_i         ),
.ibe_exp_vld_i   (ib_exp_vld_i         ),
.ibe_exp_code_i  (ib_exp_code_i        ),
.ibe_bp_taddr_i  (ib_bp_taddr_i        ),
.ibe_bp_taken_i  (ib_bp_taken_i        ),
.ibe_bp_bhtv_i   (ib_bp_bhtv_i         ),
.ibe_bp_phtv_i   (ib_bp_phtv_i         ),
.ibe_vld_o       (entry_vld_o[12]      ),
.ibe_inst_data_o (entry_inst_data_o[12]),
.ibe_pc_data_o   (entry_pc_data_o[12]  ),
.ibe_exp_vld_o   (entry_exp_vld_o[12]  ),
.ibe_exp_code_o  (entry_exp_code_o[12] ),
.ibe_bp_taddr_o  (entry_bp_taddr_o[12] ),
.ibe_bp_taken_o  (entry_bp_taken_o[12] ),
.ibe_bp_bhtv_o   (entry_bp_bhtv_o[12]  ),
.ibe_bp_phtv_o   (entry_bp_phtv_o[12]  )
);

frv_ibuf_entry _ibuf_entry_13 (
.clk             (clk                  ),
.rst_n           (rst_n                ),
.pd_rst          (pd_rst               ),
.ibe_req         (entry_wen[13]        ),
.ibe_flush       (entry_flush[13]      ),
.ibe_inst_data_i (ib_inst_data_i       ),
.ibe_pc_data_i   (ib_pc_data_i         ),
.ibe_exp_vld_i   (ib_exp_vld_i         ),
.ibe_exp_code_i  (ib_exp_code_i        ),
.ibe_bp_taddr_i  (ib_bp_taddr_i        ),
.ibe_bp_taken_i  (ib_bp_taken_i        ),
.ibe_bp_bhtv_i   (ib_bp_bhtv_i         ),
.ibe_bp_phtv_i   (ib_bp_phtv_i         ),
.ibe_vld_o       (entry_vld_o[13]      ),
.ibe_inst_data_o (entry_inst_data_o[13]),
.ibe_pc_data_o   (entry_pc_data_o[13]  ),
.ibe_exp_vld_o   (entry_exp_vld_o[13]  ),
.ibe_exp_code_o  (entry_exp_code_o[13] ),
.ibe_bp_taddr_o  (entry_bp_taddr_o[13] ),
.ibe_bp_taken_o  (entry_bp_taken_o[13] ),
.ibe_bp_bhtv_o   (entry_bp_bhtv_o[13]  ),
.ibe_bp_phtv_o   (entry_bp_phtv_o[13]  )
);

frv_ibuf_entry _ibuf_entry_14 (
.clk             (clk                  ),
.rst_n           (rst_n                ),
.pd_rst          (pd_rst               ),
.ibe_req         (entry_wen[14]        ),
.ibe_flush       (entry_flush[14]      ),
.ibe_inst_data_i (ib_inst_data_i       ),
.ibe_pc_data_i   (ib_pc_data_i         ),
.ibe_exp_vld_i   (ib_exp_vld_i         ),
.ibe_exp_code_i  (ib_exp_code_i        ),
.ibe_bp_taddr_i  (ib_bp_taddr_i        ),
.ibe_bp_taken_i  (ib_bp_taken_i        ),
.ibe_bp_bhtv_i   (ib_bp_bhtv_i         ),
.ibe_bp_phtv_i   (ib_bp_phtv_i         ),
.ibe_vld_o       (entry_vld_o[14]      ),
.ibe_inst_data_o (entry_inst_data_o[14]),
.ibe_pc_data_o   (entry_pc_data_o[14]  ),
.ibe_exp_vld_o   (entry_exp_vld_o[14]  ),
.ibe_exp_code_o  (entry_exp_code_o[14] ),
.ibe_bp_taddr_o  (entry_bp_taddr_o[14] ),
.ibe_bp_taken_o  (entry_bp_taken_o[14] ),
.ibe_bp_bhtv_o   (entry_bp_bhtv_o[14]  ),
.ibe_bp_phtv_o   (entry_bp_phtv_o[14]  )
);

frv_ibuf_entry _ibuf_entry_15 (
.clk             (clk                  ),
.rst_n           (rst_n                ),
.pd_rst          (pd_rst               ),
.ibe_req         (entry_wen[15]        ),
.ibe_flush       (entry_flush[15]      ),
.ibe_inst_data_i (ib_inst_data_i       ),
.ibe_pc_data_i   (ib_pc_data_i         ),
.ibe_exp_vld_i   (ib_exp_vld_i         ),
.ibe_exp_code_i  (ib_exp_code_i        ),
.ibe_bp_taddr_i  (ib_bp_taddr_i        ),
.ibe_bp_taken_i  (ib_bp_taken_i        ),
.ibe_bp_bhtv_i   (ib_bp_bhtv_i         ),
.ibe_bp_phtv_i   (ib_bp_phtv_i         ),
.ibe_vld_o       (entry_vld_o[15]      ),
.ibe_inst_data_o (entry_inst_data_o[15]),
.ibe_pc_data_o   (entry_pc_data_o[15]  ),
.ibe_exp_vld_o   (entry_exp_vld_o[15]  ),
.ibe_exp_code_o  (entry_exp_code_o[15] ),
.ibe_bp_taddr_o  (entry_bp_taddr_o[15] ),
.ibe_bp_taken_o  (entry_bp_taken_o[15] ),
.ibe_bp_bhtv_o   (entry_bp_bhtv_o[15]  ),
.ibe_bp_phtv_o   (entry_bp_phtv_o[15]  )
);


endmodule


